import request from '@/utils/request'

export function roleTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/system/role/table`,
    method: 'post',
    data: query
  })
}

export function roleTreeData(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/system/role/treeData`,
    method: 'post',
    data: query
  })
}

export function roleLoad(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/system/role/load`,
    method: 'get',
    params: query
  })
}

export function roleSave(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/system/role/save`,
    method: 'post',
    data: query
  })
}

export function saveRoleMenu(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/system/role/saveRoleMenu`,
    method: 'post',
    data: query
  })
}

export function saveDataScope(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/system/role/saveDataScope`,
    method: 'post',
    data: query
  })
}

export function addRoleUser(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/system/role/addRoleUser`,
    method: 'post',
    data: query
  })
}

export function deleteRoleUser(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/system/role/deleteRoleUser`,
    method: 'post',
    data: query
  })
}

export function roleDelete(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/system/role/delete`,
    method: 'post',
    data: query
  })
}
